import request from '@/utils/request'
import { Login } from "@/api/interface";
import DynamicRouter from "@/assets/json/dynamicRouter.json";
// 获取路由
export const getRouters = (postId: any) => {
  // return request({
  //   url: '/Login/selectMenuTreeByPostId?postId=' +postId,
  //   method: 'get'
  // })
  return DynamicRouter
}

export function login(data: Login.ReqLoginForm) {
    return request({
      url: '/auth/login',
      headers: {
        isToken: false
      },
      method: 'post',
      data: data
    })
  }


// 获取验证码
export function getCodeImg() {
    return request({
      url: '/kaptcha',
      headers: {
        isToken: false
      },
      method: 'get',
      timeout: 20000
    })
  }

  // 获取用户详细信息
export function getInfo() {
  return request({
    url: '/Login/selectLoginUserInfo',
    method: 'get'
  })
  
}

// 退出方法
export function logout() {
  return request({
    url: '/auth/logout',
    method: 'post'
  })
}